POV-Ray : Newsgroups : povray.newusers : Collision detection : Re: Collision detection Server Time
5 Nov 2024 09:23:10 EST (-0500)
  Re: Collision detection  
From: Chris Huff
Date: 14 Jan 2000 09:55:46
Message: <chrishuff_99-43AE9F.09560714012000@news.povray.org>
In article <387f2261@news.povray.org>, "Tom Melly" 
<tom### [at] tomandluforce9couk> wrote:

> Hi, has anyone got any general advice/links/macros/whatever on collision
> detection in POV?

What do you want to detect collisions of? If it is simply two spheres, 
use something like
#if(vlength(CenterA - CenterB)<(RadiusA + RadiusB))
   // spheres are colliding
#else
   // spheres are not colliding
#end

The math is pretty simple for many other objects. I don't know of any 
macros for this.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.